package rules;

import stock.Company;

public class SellRule11 extends Rule {

	@Override
	public boolean matches(Company company) {

		//Week Positive Variation
		boolean positiveVariation1 = ((company.getWeekInfo().get(1)-company.getWeekInfo().get(0)) > 0);
		boolean positiveVariation2 = ((company.getWeekInfo().get(2)-company.getWeekInfo().get(1)) > 0);
		boolean positiveVariation3 = ((company.getWeekInfo().get(3)-company.getWeekInfo().get(2)) > 0);
		boolean positiveVariation4 = ((company.getWeekInfo().get(4)-company.getWeekInfo().get(3)) > 0);
		
		boolean weekPositiveVariation = (positiveVariation1 && positiveVariation2 && positiveVariation3 && positiveVariation4);

		if ( weekPositiveVariation ){
			return this.next(company);
		}
		
		return false;
	}

}
